package com.woniuxy.project.campus.technical.controller;


import com.woniuxy.project.campus.technical.config.WebSocketUtil;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/websocket")
public class WebSocketController {

    @Resource
    private WebSocketUtil webSocketUtil;

    @ApiOperation("发送通知")
    @GetMapping("/sendCode")
    public void sendCode(@RequestParam("userId") String userId, @RequestParam("message") String message) {
        webSocketUtil.sendNotification(userId, message);
    }
}
